import unittest


import requests
from parameterized import parameterized

from p2p.api import log
from p2p.api.api_approve_trust import ApiApproveTrust
from p2p.api.api_register_login import ApiRegisterLogin
from p2p.api.api_tender import ApiTender
from p2p.util import read_json

class TestTenderList(unittest.TestCase):
    def setUp(self) -> None:
        self.session=requests.session()
        self.reg=ApiRegisterLogin(self.session)
        self.approve=ApiApproveTrust(self.session)
        self.tender=ApiTender(self.session)

    def tearDown(self) -> None:
        self.session.close()

    def test_tender_list(self):
        phone="19850097849"
        pwd="123456"
        code="8888"
        phone_code="666666"
        card_id="350102199003072240"
        amount=1000
        self.reg.api_picture_code(123)
        self.reg.api_message_code(phone,code)
        self.reg.api_register(phone,pwd,code,phone_code)
        self.reg.api_login(phone,pwd)

        self.approve.api_approve(card_id)
        self.approve.api_trust()
        self.approve.api_img_code(123123)  # 获取充值验证码
        self.approve.api_recharge(code)   # 后台充值

        self.tender.api_tender(amount)   # 后台投资